<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>左右定宽 中间自适应-四种方法(左中右结构)</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    /* float + position + flex + grid
    calc()
    */
    #parent{overflow:hidden}
    #left{width:200px;height: 500px;background-color: blueviolet;}
    #center{height: 600px;background-color: blue;margin:0 200px;}
    #right{width:200px;height: 500px;background-color: greenyellow;}

    #left{float:left}
    #right{float:right}
  </style>
</head>

<body>
  <div id="parent">
    <div id="left">左</div>
    <div id="right">右</div>
    <div id="center">中</div>
  </div>


  <!-- 设计思想 - center优先加载 dom结构靠前 -->
  <!-- <div id="parent">
      <div id="center"></div>
      <div id="left"></div>
      <div id="right"></div>
  </div> -->
</body>

</html>